<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<script>
	var contentPage = {
        			submitForm:function(){
        				
        				if(!$('#myForm').form('validate')){
        					$.messager.alert('提示','信息不完整');
        					return ;
    					}else{
    						$.post("Employees/addEmployees",$("#myForm").serialize(),function(data){
    	    					if(data == 200){
    	    						$.messager.alert('提示','添加成功');
    	    						$("#myForm").form("reset");
//  	    						$("#d").window("close");
//  	    						$("#ta").datagrid("reload");
    	    					}else{
    	    						$.messager.alert('提示','添加失败');
    	    					}
    	    				});
    						
    					}
        				
        			},
        			clearForm:function(){
        				$("#myForm").form("reset");
        			}
        	};
</script>
<form id="myForm">
<table border="0" cellspacing="0" cellpadding="0" align="center" width="40%" style="margin-top: 10%;">
	<tr align="center" height='50'>
		<td>
			<label for="staffname">姓名</label>
		</td>
		<td>
			<input class="easyui-textbox" style="width: 100%;" type="text" name="staffname" id="staffname" required value="" />
		</td>
	</tr>
	<tr align="center" height='50'>
		<td>
			<label for="staffsex">性别</label>
		</td>
		<td>
			<input type="radio" name="staffsex" id="staffsex" value="男" checked />男
			<input type="radio" name="staffsex" id="staffsex" value="女" />女
		</td>
	</tr>
	<tr align="center" height='50'>
		<td>
			<label for="stafftel">电话</label>
		</td>
		<td>
			<input type="tel" class="easyui-textbox" style="width: 100%;" name="stafftel" id="stafftel" required value="" />
		</td>
	</tr>
	<tr align="center" height='50'>
		<td>
			<label for="staffpost">职位</label>
		</td>
		<td>
			<input class="easyui-textbox" style="width: 100%;"type="text" name="staffpost" id="staffpost" required value="" />
		</td>
	</tr>
	<tr align="center" height='50'>
		<td>
			<label for="staffsal">薪资</label>
		</td>
		<td>
			<input class="easyui-textbox" style="width: 100%;" type="number" name="staffsal" id="staffsal" required value="" />
		</td>
	</tr>
	<tr align="center" height='50'>
		<td>
			<label for="staffcomm">提成</label>
		</td>
		<td>
			<input class="easyui-textbox" style="width: 100%;" type="number" name="staffcomm" id="staffcomm" value="" />
		</td>
	</tr>
	<tr align="center" height='50'>
		<td colspan="2">
			<a href="javascript:void(0)" onclick="contentPage.submitForm()" class="easyui-linkbutton" data-options="iconCls:'icon-add'">添加</a>&nbsp;&nbsp;&nbsp;&nbsp;
			<a href="javascript:void(0)" onclick="contentPage.clearForm()" class="easyui-linkbutton" data-options="iconCls:'icon-redo'">重置</a>
		</td>
	</tr>
</table>
</form>
